﻿@model SelfMadeMillionaire.Web.Infrastructure.ViewModels.Newss.NewsEditViewModel
@using SelfMadeMillionaire.Web.Infrastructure

<div class="row">
	<div class="col-sm-4">
		<div class="form-group">
			@Html.LabelFor(model => model.News.ProductType, new { @class = "col-sm-6 control-label" })
			<div class="col-sm-6">
				@Html.DropDownListFor(m => m.News.ProductType, Model.ProductTypes, new { @class = "form-control" })
				@Html.ValidationMessageFor(model => model.News.ProductType)
			</div>
		</div>
	</div>

	<div class="col-sm-6">
		<div class="form-group">
			@Html.LabelFor(model => model.News.Title, new { @class = "col-sm-2 control-label" })
			<div class="col-sm-10">
				@Html.TextBoxFor(model => model.News.Title, new { @class = "form-control" })
				@Html.ValidationMessageFor(model => model.News.Title)
			</div>
		</div>
	</div>
	<div class="col-sm-2">
		<div class="form-group">
			<label class="col-sm-3 control-label">Date</label>
			<div class="col-sm-9">
				@Html.TextBoxFor(model => model.News.Date, "{0:" + Constants.DATE_FORMAT + "}", new { @class = "form-control" })
				@Html.ValidationMessageFor(model => model.News.Date)
			</div>
		</div>
	</div>
</div>
<div class="row">
    <div class="col-sm-12">
		<div class="form-group">
			@Html.LabelFor(model => model.News.ExternalUrl, new { @class = "col-sm-2 control-label" })
			<div class="col-sm-10">
				@Html.TextBoxFor(model => model.News.ExternalUrl, new { @class = "form-control" })
				@Html.ValidationMessageFor(model => model.News.ExternalUrl)
			</div>
		</div>
	</div>
</div>
<div class="row">
    <div class="col-sm-12">
		<div class="form-group">
			@Html.LabelFor(model => model.News.Tooltip, new { @class = "col-sm-2 control-label" })
			<div class="col-sm-10">
				@Html.TextBoxFor(model => model.News.Tooltip, new { @class = "form-control" })
				@Html.ValidationMessageFor(model => model.News.Tooltip)
			</div>
		</div>
	</div>
</div>
<div class="row">
    <div class="col-sm-4">
		<div class="form-group">
			@Html.LabelFor(model => model.MinAccessLevel, new { @class = "col-sm-6 control-label" })
			<div class="col-sm-6">
				@Html.DropDownListFor(m => m.News.MinAccessLevel, Model.AccessLevels, new { @class = "form-control" })
			</div>
		</div>
	</div>
</div>
<div class="row">
    <label class = "col-sm-2 control-label">Portfolios</label>
    @for (int i = 1; i < Model.ProductTypes.Count(); ++i )
    {
        var item = Model.ProductTypes.ElementAt(i);
        <div class="col-sm-2">
		<div class="form-group">
			<label class="col-sm-12 control-label">
				@item.Text
                <input type="checkbox" name="SelectedProducts" value="@item.Value" id="@item.Value" @{if (Model.SelectedProducts.Contains(Convert.ToInt32(item.Value)))
                                                                                                      { <text> checked='checked' </text>  } } />
			</label>
		</div>
	    </div>
        }
</div>


<script type="text/javascript">

	$(function () {
		$("#@Html.IdFor(m => m.News.Date)").datepicker();
	});

</script>
